package com.tao.design.strategy.demo2;

/**
 * @Author Mi_Tao
 * @Date 2023/4/14
 * @Description
 * @Version 1.0
 **/
public class StrategyTest {

    public static void main(String[] args) {

        PaymentEnum payType = PaymentEnum.Weixin;
        Order2 order = new Order2();

        PayResult payResult = PaymentFactory.getPayment(payType).pay(order);
        if (payResult == PayResult.SUCCESS) {
            System.out.println("支付成功");
        } else if ( "支付宝".equals(payType)) {
            System.out.println("支付失败");
        }

    }
}
